DbServiceImpl{
  Permissions perms=new Permissions();
  ProtectionDomain domain=new ProtectionDomain(new CodeSource(null,(Certificate[])null),perms);
  evalContext=new AccessControlContext(new ProtectionDomain[]{domain});
}
executeGremlinQueries{
  List<Object> result=new ArrayList<Object>();
    result.add(this.executeQuery(gremlinQuery,null,engine));
    List<Vertex> startNodes=new ArrayList<Vertex>();
    for (    Vertex v : startNodes) {
      result.add(this.executeQuery(gremlinQuery,v,engine));
}
executeGremlinQuery{ }
entityRepresentation{
  if (entity instanceof Vertex) {
    Vertex v=(Vertex)entity;
    for (    String key : v.getPropertyKeys()) {
      properties.put(key,v.getProperty(key));
    vertex.put("properties",properties);
    return vertex;
 else   if (entity instanceof Edge) {
 else   if (entity instanceof Graph) {
 else   if (entity instanceof Double || entity instanceof Float) {
    return ((Number)entity).doubleValue();
 else   if (entity instanceof Long || entity instanceof Integer) {
    return ((Number)entity).longValue();
 else   if (entity instanceof BigDecimal) {
    return ((BigDecimal)entity).doubleValue();
 else   if (entity == null) {
    return null;
 else   if (entity instanceof Iterable<?>) {
    for (    final Object r : (Iterable<?>)entity) {
  return entity.toString();
}
executeQuery{
    engine.getBindings(ScriptContext.ENGINE_SCOPE).put("v",startNode);
  exception=null;
  AccessController.doPrivileged(new PrivilegedAction<Object>(){
        result=engine.eval(gremlinQuery);
 catch (      ScriptException e) {
  if (exception != null) {
    throw new ScriptException("from doPriv: " + exception.getMessage());
    final List<Object> results=new ArrayList<Object>();
    for (    final Object r : (Iterable<?>)result) {
      results.add(this.entityRepresentation(r));
    return results;
    return this.entityRepresentation(result);
}
run{
  try {
 catch (  ScriptException e) {
    exception=e;
}
getScriptEngine{
  ScriptEngineManager manager=new ScriptEngineManager();
  engine.getBindings(ScriptContext.ENGINE_SCOPE).put("g",new Neo4jGraph(this.template.getGraphDatabaseService()));
  Nodes n=new Nodes(engine);
  engine.getBindings(ScriptContext.ENGINE_SCOPE).put("f",filters);
  engine.getBindings(ScriptContext.ENGINE_SCOPE).put("n",n);
  engine.getBindings(ScriptContext.ENGINE_SCOPE).put("tick",Schedule.getSchedule().getCurrentTick());
  return engine;
}
getStartNodes{
  return new ArrayList<String>(nodeEntityHelper.getNodeEntityMap().keySet());
}
getFilters{ }
setFilters{ }
Nodes{ }
getNodes{
}
